package com.example.multipleenvironment.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Value("${msg}")
    private String msg;

    /**
     * 需要跳过src/test下的编译，才能编译成功
     * 然后在命令行中执行 java -jar multipleenvironment-0.0.1-SNAPSHOT.jar --spring.profiles.active=test
     *
     * @return
     */
    @RequestMapping("/displayMsg")
    public String displayMsg(){
        return "hello,"+msg;
    }

}
